<%@ page import="org.security.Resource" %>



<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'url', 'error')} required">
	<label for="url">
		<g:message code="resource.url.label" default="Url" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="url" required="" value="${resourceInstance?.url}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'type', 'error')} required">
	<label for="type">
		<g:message code="resource.type.label" default="Type" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="type" from="${resourceInstance.constraints.type.inList}" required="" value="${resourceInstance?.type}" valueMessagePrefix="resource.type"/>
</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'configAttribute', 'error')} required">
	<label for="configAttribute">
		<g:message code="resource.configAttribute.label" default="Config Attribute" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="configAttribute" required="" value="${resourceInstance?.configAttribute}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'displayName', 'error')} required">
	<label for="displayName">
		<g:message code="resource.displayName.label" default="Display Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="displayName" required="" value="${resourceInstance?.displayName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'remark', 'error')} ">
	<label for="remark">
		<g:message code="resource.remark.label" default="Remark" />
		
	</label>
	<g:textArea name="remark" cols="40" rows="5" value="${resourceInstance?.remark}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'chidrens', 'error')} ">
	<label for="chidrens">
		<g:message code="resource.chidrens.label" default="Chidrens" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${resourceInstance?.chidrens?}" var="c">
    <li><g:link controller="resource" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="resource" action="create" params="['resource.id': resourceInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'resource.label', default: 'Resource')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'parent', 'error')} required">
	<label for="parent">
		<g:message code="resource.parent.label" default="Parent" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="parent" name="parent.id" from="${org.security.Resource.list()}" optionKey="id" required="" value="${resourceInstance?.parent?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: resourceInstance, field: 'roles', 'error')} ">
	<label for="roles">
		<g:message code="resource.roles.label" default="Roles" />
		
	</label>
	
</div>

